import java.util.*;
public class SumofRecur2{
	public static void main (String [] args){
  		long sum = 0;
		System.out.print("java SumofRecur ");
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		if(N==0){
		System.out.println("sum=1");
		}
		else if(N<0){
		System.out.println("Input error");
		}
		else{
		for(int i=N;i>0;i--){
		sum=sum+K.sum(i);
                }
		System.out.println("sum="+sum);
}
}
}
class K{
		static long sum(int N){
    		if (N==1)
        		return 1;
    		else
       			return sum(N-1) * N;
		}
}  